package com.zzyl.nursing.controller.member;/**
 * @author wl
 * @version 1.0
 * @since 2025-08-18 16:09
 */

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.R;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.domain.NursingProject;
import com.zzyl.nursing.service.INursingProjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 *des:
 *data Created in 2025-08-18 16-09
 */
@RestController
@RequestMapping("/member/orders/project")
@Api(tags = "小程序项目管理")
public class MemberOrderController extends BaseController {

    @Autowired
    private INursingProjectService nursingProjectService;

    /**
     * 分页获取所有项目
     * @param nursingProject
     * @return
     */
    @GetMapping("/page")
    public TableDataInfo<List<NursingProject>> list(@ApiParam("护理项目查询条件") NursingProject nursingProject)
    {
        startPage();
        List<NursingProject> list = nursingProjectService.selectNursingProjectList(nursingProject);
        return getDataTable(list);
    }



    /**
     * 获取护理项目详细信息
     */
    @ApiOperation("获取护理项目详细信息")
    @GetMapping("/{id}")
    public R<NursingProject> getInfo(@ApiParam("护理项目ID") @PathVariable("id") Long id)
    {
        return R.ok(nursingProjectService.selectNursingProjectById(id));
    }
}
